<?php
/*
 * Created on Jul 30, 2012
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

echo "size = " . getSize2(142400, 124, 24, 8, 14234);

function getSize()
{
	$max 	= 100;
	$min 	= 1;
	$value 	= 20;
	
	$rs = (log($value) - log($min)) / (log($max) - log($min)) * (20 - 8) + 1;
	
	return $rs;
}

function getSize2($datamax, $datamin, $fontmax, $fontmin, $datavalue)
{
	$datascale = ($datavalue - $datamin) / ($datamax - $datamin);
	
	$rs = $fontmin + ($fontmax - $fontmin) * $datascale;
	
	return round ($rs);
}
?>
